package com.mikasa.springboot.example.rabbitmq.demo;

import com.mikasa.springboot.example.domain.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by User on 17/1/16.
 */
@Component
@RabbitListener(queues = {"topic.message","topic.messages"})
public class ReceiverMessage {

    private static final Logger LOGGER = LoggerFactory.getLogger(ReceiverMessage.class);

    @RabbitHandler
    public void handler1(String message){
        LOGGER.info("ReceiverMessage : " + message);
    }

    @RabbitHandler
    public void handler2(User user){
        LOGGER.info("ReceiverMessage : " + user);
    }
}
